package com.kang.work;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component
public class WorkCustomer {

    //一个消费者
    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receivel(String msg) {
        System.out.println("message1 = " + msg);
    }

    //一个消费者
    @RabbitListener(queuesToDeclare = @Queue("work"))
    public void receivel2(String msg) {
        System.out.println("message2 = " + msg);
    }
}
